#include <a_samp>

new Menu:wepmenu,
	Menu:wepmenu_melee,
	Menu:wepmenu_pistols,
	Menu:wepmenu_shotguns,
	Menu:wepmenu_auto,
	Menu:wepmenu_rifles,
	Menu:wepmenu_heavy,
	Menu:wepmenu_thrown,
	Menu:wepmenu_items;


script_WepMenu_LoadMenu()
{
	wepmenu = CreateMenu("~w~Weapon Menu",1,20,200,200);
	AddMenuItem(wepmenu, 0, "Melee");
	AddMenuItem(wepmenu, 0, "Pistols");
	AddMenuItem(wepmenu, 0, "Shotguns");
	AddMenuItem(wepmenu, 0, "Automatic");
	AddMenuItem(wepmenu, 0, "Rifles");
	AddMenuItem(wepmenu, 0, "Heavy");
	AddMenuItem(wepmenu, 0, "Thrown");
	AddMenuItem(wepmenu, 0, "Items");

	//--melee
	wepmenu_melee = CreateMenu("~w~",1,20,200,200);

	AddMenuItem(wepmenu_melee, 0, WepData[1][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[2][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[3][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[4][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[5][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[6][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[7][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[8][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[9][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[14][WepName]);
	AddMenuItem(wepmenu_melee, 0, WepData[15][WepName]);

	//--pistols
	wepmenu_pistols = CreateMenu("~w~",1,20,200,200);

	AddMenuItem(wepmenu_pistols, 0, WepData[22][WepName]);
	AddMenuItem(wepmenu_pistols, 0, WepData[23][WepName]);
	AddMenuItem(wepmenu_pistols, 0, WepData[24][WepName]);

	//--shotguns
	wepmenu_shotguns = CreateMenu("~w~",1,20,200,200);

	AddMenuItem(wepmenu_shotguns, 0, WepData[25][WepName]);
	AddMenuItem(wepmenu_shotguns, 0, WepData[26][WepName]);
	AddMenuItem(wepmenu_shotguns, 0, WepData[27][WepName]);

	//--auto
	wepmenu_auto = CreateMenu("~w~",1,20,200,200);

	AddMenuItem(wepmenu_auto, 0, WepData[31][WepName]);
	AddMenuItem(wepmenu_auto, 0, WepData[29][WepName]);
	AddMenuItem(wepmenu_auto, 0, WepData[30][WepName]);
	AddMenuItem(wepmenu_auto, 0, WepData[28][WepName]);
	AddMenuItem(wepmenu_auto, 0, WepData[32][WepName]);

	//--rifles
	wepmenu_rifles = CreateMenu("~w~",1,20,200,200);

	AddMenuItem(wepmenu_rifles, 0, WepData[34][WepName]);
	AddMenuItem(wepmenu_rifles, 0, WepData[33][WepName]);

	//--heavy
	wepmenu_heavy = CreateMenu("~w~",1,20,200,200);

	AddMenuItem(wepmenu_heavy, 0, WepData[35][WepName]);
	AddMenuItem(wepmenu_heavy, 0, WepData[36][WepName]);
	AddMenuItem(wepmenu_heavy, 0, WepData[37][WepName]);
	AddMenuItem(wepmenu_heavy, 0, WepData[38][WepName]);

	//--thrown
	wepmenu_thrown = CreateMenu("~w~",1,20,200,200);

	AddMenuItem(wepmenu_thrown, 0, WepData[16][WepName]);
	AddMenuItem(wepmenu_thrown, 0, WepData[17][WepName]);
	AddMenuItem(wepmenu_thrown, 0, WepData[18][WepName]);
	AddMenuItem(wepmenu_thrown, 0, WepData[39][WepName]);

	//--items
	wepmenu_items = CreateMenu("~w~",1,20,200,200);

	AddMenuItem(wepmenu_items, 0, WepData[41][WepName]);
	AddMenuItem(wepmenu_items, 0, WepData[42][WepName]);
	AddMenuItem(wepmenu_items, 0, WepData[43][WepName]);
	AddMenuItem(wepmenu_items, 0, WepData[44][WepName]);
	AddMenuItem(wepmenu_items, 0, WepData[45][WepName]);
	AddMenuItem(wepmenu_items, 0, WepData[46][WepName]);
}

script_WepMenu_MenuRow(playerid, row, Menu:pMenu)
{
	if (pMenu == wepmenu)
	{
		switch(row)
		{
			case 0:{ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 1:{ShowMenuForPlayer(wepmenu_pistols, playerid);}
			case 2:{ShowMenuForPlayer(wepmenu_shotguns, playerid);}
			case 3:{ShowMenuForPlayer(wepmenu_auto, playerid);}
			case 4:{ShowMenuForPlayer(wepmenu_rifles, playerid);}
			case 5:{ShowMenuForPlayer(wepmenu_heavy, playerid);}
			case 6:{ShowMenuForPlayer(wepmenu_thrown, playerid);}
			case 7:{ShowMenuForPlayer(wepmenu_items, playerid);}
		}
	}
	if (pMenu == wepmenu_melee)
	{
		switch(row)
		{
			case 0:{GivePlayerWeapon(playerid, 1, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 1:{GivePlayerWeapon(playerid, 2, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 2:{GivePlayerWeapon(playerid, 3, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 3:{GivePlayerWeapon(playerid, 4, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 4:{GivePlayerWeapon(playerid, 5, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 5:{GivePlayerWeapon(playerid, 6, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 6:{GivePlayerWeapon(playerid, 7, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 7:{GivePlayerWeapon(playerid, 8, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 8:{GivePlayerWeapon(playerid, 9, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 9:{GivePlayerWeapon(playerid, 14, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
			case 10:{GivePlayerWeapon(playerid, 15, 1);ShowMenuForPlayer(wepmenu_melee, playerid);}
		}
	}
	if (pMenu == wepmenu_pistols)
	{
		switch(row)
		{
			case 0:{GivePlayerWeapon(playerid, 22, 56);ShowMenuForPlayer(wepmenu_pistols, playerid);}
			case 1:{GivePlayerWeapon(playerid, 23, 56);ShowMenuForPlayer(wepmenu_pistols, playerid);}
			case 2:{GivePlayerWeapon(playerid, 24, 56);ShowMenuForPlayer(wepmenu_pistols, playerid);}
		}
	}
	if (pMenu == wepmenu_shotguns)
	{
		switch(row)
		{
			case 0:{GivePlayerWeapon(playerid, 25, 40);ShowMenuForPlayer(wepmenu_shotguns, playerid);}
			case 1:{GivePlayerWeapon(playerid, 26, 40);ShowMenuForPlayer(wepmenu_shotguns, playerid);}
			case 2:{GivePlayerWeapon(playerid, 27, 40);ShowMenuForPlayer(wepmenu_shotguns, playerid);}
		}
	}
	if (pMenu == wepmenu_auto)
	{
		switch(row)
		{
			case 0:{GivePlayerWeapon(playerid, 31, 100);ShowMenuForPlayer(wepmenu_auto, playerid);}
			case 1:{GivePlayerWeapon(playerid, 29, 100);ShowMenuForPlayer(wepmenu_auto, playerid);}
			case 2:{GivePlayerWeapon(playerid, 30, 100);ShowMenuForPlayer(wepmenu_auto, playerid);}
			case 3:{GivePlayerWeapon(playerid, 28, 100);ShowMenuForPlayer(wepmenu_auto, playerid);}
			case 4:{GivePlayerWeapon(playerid, 32, 100);ShowMenuForPlayer(wepmenu_auto, playerid);}
		}
	}
	if (pMenu == wepmenu_rifles)
	{
		switch(row)
		{
			case 0:{GivePlayerWeapon(playerid, 34, 100);ShowMenuForPlayer(wepmenu_rifles, playerid);}
			case 1:{GivePlayerWeapon(playerid, 33, 100);ShowMenuForPlayer(wepmenu_rifles, playerid);}
		}
	}
	if (pMenu == wepmenu_heavy)
	{
		switch(row)
		{
			case 0:
			{
				if( (!specweps) || (pAdmin(playerid) <= 3) )
				{
					msg(playerid, ORANGE, "Not Allowed Right Now");
				}
				else if( (specweps) || (pAdmin(playerid) > 5) )
				{
					GivePlayerWeapon(playerid, 35, 20);
					ShowMenuForPlayer(wepmenu_heavy, playerid);
				}
			}
			case 1:
			{
				if( (!specweps) || (pAdmin(playerid) <= 3) )
				{
					msg(playerid, ORANGE, "Not Allowed Right Now");
				}
				else if( (specweps) || (pAdmin(playerid) > 5) )
				{
					GivePlayerWeapon(playerid, 36, 20);
					ShowMenuForPlayer(wepmenu_heavy, playerid);
				}
			}
			case 2:
			{
				if( (!specweps) || (pAdmin(playerid) <= 3) )
				{
					msg(playerid, ORANGE, "Not Allowed Right Now");
				}
				else if( (specweps) || (pAdmin(playerid) > 5) )
				{
					GivePlayerWeapon(playerid, 37, 1000);
					ShowMenuForPlayer(wepmenu_heavy, playerid);
				}
			}
			case 3:
			{
				if( (!specweps) || (pAdmin(playerid) <= 3) )
				{
					msg(playerid, ORANGE, "Not Allowed Right Now");
				}
				else if( (specweps) || (pAdmin(playerid) > 5) )
				{
					GivePlayerWeapon(playerid, 38, 1000);
					ShowMenuForPlayer(wepmenu_heavy, playerid);
				}
			}
		}
	}
	if (pMenu == wepmenu_thrown)
	{
		switch(row)
		{
			case 0:{GivePlayerWeapon(playerid, 16, 5);ShowMenuForPlayer(wepmenu_thrown, playerid);}
			case 1:{GivePlayerWeapon(playerid, 17, 5);ShowMenuForPlayer(wepmenu_thrown, playerid);}
			case 2:{GivePlayerWeapon(playerid, 18, 5);ShowMenuForPlayer(wepmenu_thrown, playerid);}
			case 3:{GivePlayerWeapon(playerid, 39, 5);ShowMenuForPlayer(wepmenu_thrown, playerid);}
		}
	}
	if (pMenu == wepmenu_items)
	{
		switch(row)
		{
			case 0:{GivePlayerWeapon(playerid, 41, 100);ShowMenuForPlayer(wepmenu_items, playerid);}
			case 1:{GivePlayerWeapon(playerid, 42, 100);ShowMenuForPlayer(wepmenu_items, playerid);}
			case 2:{GivePlayerWeapon(playerid, 43, 100);ShowMenuForPlayer(wepmenu_items, playerid);}
			case 3:{GivePlayerWeapon(playerid, 44, 100);ShowMenuForPlayer(wepmenu_items, playerid);}
			case 4:{GivePlayerWeapon(playerid, 45, 100);ShowMenuForPlayer(wepmenu_items, playerid);}
			case 5:{GivePlayerWeapon(playerid, 46, 100);ShowMenuForPlayer(wepmenu_items, playerid);}
		}
	}
}

